package com.boot.down.controller;

import com.boot.down.service.OrderSecKillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author dell
 */
@RestController
@RequestMapping("/order")
public class OrderSecKillController {


	@Autowired
	private OrderSecKillService orderSecKillService;


	@GetMapping("/create")
	public String createOrder(@RequestParam(name = "productId",defaultValue = "123123") String productId) {

		return orderSecKillService.secKillOrder(productId);
	}

	@GetMapping("/query")
	public String productNum(@RequestParam(name = "productId",defaultValue = "123123") String productId) {
        //查询库存
		return orderSecKillService.queryProductStock(productId);
	}

}
